<template>
  <div class="side-button-container">
    <button class="btn" title="回到顶部" v-show="isArriveBottom" @click="goTop">
      <img src="../../assets/img/home-bottom/toTop.png" />
    </button>
    <button class="btn bottom" title="建议与反馈">
      <img src="../../assets/img/home-bottom/feedback.png" />
    </button>
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
export default {
  data() {
    return {}
  },
  created() {},
  methods: {
    ...mapMutations(['updateIsArriveBottom', 'updateisShowAD']),
    goTop() {
      document.documentElement.scrollTop = 0
      this.updateisShowAD(false)
    }
  },
  computed: {
    ...mapState(['isArriveBottom'])
  }
}
</script>

<style lang="less" scoped>
.side-button-container {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  display: flex;
  flex-direction: column;

  .btn {
    width: 3.33rem;
    height: 3.33rem;
    margin-top: 1rem;
    border-radius: 50%;
    color: var(--taojin-font-3);
    border: 1px solid #f1f1f1;
    background-color: var(--taojin-backgroung-color);
    cursor: pointer;

    i {
      font-size: 1.6rem;
    }
  }

  .btn:hover {
    box-shadow: 0 0 5px #ddd;
  }

  .bottom {
    color: var(--hover-color);
  }
}
</style>
